package com.lizardmind.haofudoctor.ui.diagnosis.diagnose.userFill

import android.databinding.ObservableArrayList
import android.databinding.ObservableField
import android.databinding.ObservableInt
import com.linxiao.framework.viewModel.LifecycleViewModel
import com.lizardmind.haofudoctor.R
import com.lizardmind.haofudoctor.other.DiagnoseDocumentsBean
import com.luck.picture.lib.entity.LocalMedia

/**
 *  填写问诊单第一个界面的viewmodel
 * Created by Extends on 2017/11/10 15:57
 */
class FillDiagnoseOneVM: LifecycleViewModel() {
    lateinit var bean : DiagnoseDocumentsBean
    var describe = ObservableField<String>("")
    var tongue_picture = ObservableArrayList<LocalMedia>()
    var related_picture = ObservableArrayList<LocalMedia>()
    var candidate = ObservableArrayList<String>()
    var select = ObservableInt(0)
    val defImg = R.mipmap.camera

    fun setBeanData(ddb:DiagnoseDocumentsBean){
        bean = ddb
        bean.candidate_info.forEach {
            candidate.add(it.name+" "+(if(it.sex==1)"男" else "女")+" "+it.age+"岁")
        }
    }

}